import java.util.Arrays;

public class Test {

    public static void main(String[] args) {
        /*Dog dog = null;
        System.out.println(dog.name);*/

        Dog dog1 = new Dog();
        dog1.age = 2;
    }

    public static void main6(String[] args) {
        GirlFriend girlFriend = new GirlFriend();

        girlFriend.name = "翠花";
        girlFriend.age = 20;
        girlFriend.gender = "女";

        System.out.println("姓名:" + girlFriend.name);
        System.out.println("年龄:" + girlFriend.age);
        System.out.println("性别:" + girlFriend.gender);

        girlFriend.eat();

        GirlFriend girlFriend1 = new GirlFriend();
        girlFriend1.name = "小红";
        girlFriend1.age = 19;
        girlFriend1.gender = "女";

        System.out.println("姓名:" + girlFriend1.name);
        System.out.println("年龄:" + girlFriend1.age);
        System.out.println("性别:" + girlFriend1.gender);
        girlFriend1.eat();
    }

    public static void main5(String[] args) {
        GirlFriend girlFriend = new GirlFriend();

        Dog dog = new Dog();

        WashMachine washMachine = new WashMachine();

        int a;
        int[] array = new int[3];
    }

    public static void main4(String[] args) {
        for (int i = 0; i < args.length; i++) {
            System.out.println(args[i]);
        }
    }

    public static void func(int[] array){
        int i = 0;
        int j = array.length-1;
        while(i < j){
            while(i < j && array[i] % 2 != 0){
                i++;
            }

            while(i < j && array[j] % 2 == 0){
                j--;
            }

            int tmp = array[i];
            array[i] = array[j];
            array[j] = tmp;
        }
    }

    public static int[] func1(int[] array, int target){
        int[] ret = {-1,-1};
        for (int i = 0; i < array.length; i++) {
            for (int j = i+1; j < array.length; j++) {
                if(array[i] + array[j] == target){
                    ret[0] = i;
                    ret[1] = j;
                    return ret;
                }
            }
        }

        return ret;
    }

    public static int func2(int[] array){
        Arrays.sort(array);
        return array[array.length/2];
    }

    public static void main3(String[] args) {
        int[] array = {2,2,3,3,2,1,3,2};
        System.out.println(func2(array));
    }

    public static void main2(String[] args) {
        int[] array = {1,2,3,7};
        int[] ret = func1(array, 5);
        System.out.println(Arrays.toString(ret));
    }
    public static void main1(String[] args) {
        int[] array = {1,2,3,4,5,6};
        func(array);
        System.out.println(Arrays.toString(array));
    }
}
